/*
 * Copyright (c) 2013 iTAC Software AG, Germany. All Rights Reserved.
 * 
 * This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
 * printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
 * without the written permission of iTAC Software AG.
 */
package org.template.portal;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

// TODO
/**
 * @author rafal.kojta
 */
@Entity
@Table(name = "group_calendar")
public class GroupCalendar {

  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "GROUP_CALENDAR_ID", unique = true, nullable = false)
  private long groupCalendarId;

  @OneToOne(fetch = FetchType.LAZY)
  @PrimaryKeyJoinColumn
  private YearGroup yearGroup;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "groupCalendar")
  Set<CalendarEntry> calendarEntries;

  public GroupCalendar() {

  }

  public long getGroupCalendarId() {
    return groupCalendarId;
  }

  public void setGroupCalendarId(long groupCalendarId) {
    this.groupCalendarId = groupCalendarId;
  }

  public YearGroup getYearGroup() {
    return yearGroup;
  }

  public void setYearGroup(YearGroup group) {
    this.yearGroup = group;
  }

  public Set<CalendarEntry> getCalendarEntries() {
    return calendarEntries;
  }

  public void setCalendarEntries(Set<CalendarEntry> calendarEntries) {
    this.calendarEntries = calendarEntries;
  }

}
